package com.coderman.basketball.statistics.service;

import com.coderman.basketball.statistics.context.CalculateContextBO;
import com.coderman.basketball.statistics.context.DataBO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Description:
 * date: 2021/5/27
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 * 投篮计算
 */
@CalculateTag(calculateType = "shooting")
@Component(value = "shootingCalculateServiceImpl")
public class ShootingCalculateServiceImpl implements CalculateService{

    @Autowired
    private DataService dataService;

    @Override
    public void calculate(CalculateContextBO calculateBO) {
        DataBO dataBO = new DataBO();
        dataBO.setPlayerId(calculateBO.getPlayerId());
        dataBO.setGameId(calculateBO.getGameId());
        dataBO.setKey(calculateBO.getActionKey());
        dataBO.setTeamName(calculateBO.getTeamName());
        dataBO.setCount(calculateBO.getCount());
        dataService.updateDataKey(dataBO);
    }
}
